package oop2;

public class TestStringBuilder {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder("");
        String str = "郝振宇,田龙,白云天,李发荣";
        sb.append(str);
        System.out.println(sb.toString());
        int index  = str.lastIndexOf(",");
        sb.delete(index,str.length());
        System.out.println(sb.toString());
        sb.append(",张荣昊");
        System.out.println(sb.toString());
        sb.replace(4,6,"庄祎博");
        System.out.println(sb.toString());
        sb.insert(sb.length(),",宁彬彬");
        System.out.println(sb.toString());
        sb.insert(0,"汪亚军,");
        System.out.println(sb.toString());
    }
}
